<extend name="Layout/page_detail" />
<block name="content">
{:W('PageHeader/simple',array('name'=>'编辑事项','search'=>'N'))}
<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"   class="well form-horizontal">
	<input type="hidden" id="id" name="id" value="{$vo.id}">
	<input type="hidden" id="ajax" name="ajax" value="0">
	<input type="hidden" id="add_file" name="add_file" value="{$vo.add_file}">
	<input type="hidden" id="opmode" name="opmode" value="edit">
	<div class="form-group">
		<label class="col-sm-2 control-label" for="name">标题*：</label>
		<div class="col-sm-10">
			<input value="{$vo.name}" class="form-control" type="text" id="name" name="name" check="require" msg="请输入标题">
		</div>
	</div>

	<div class="form-group col-sm-6">
		<label class="col-sm-4 control-label" for="end_date">结束：</label>
		<div class="col-sm-8">
			<input data-date-format="yyyy-mm-dd" type="text" id="end_date" name="end_date" readonly="readonly" class="form-control input-date" value="{$vo.end_date}">
		</div>
	</div>

	<div class="form-group col-sm-6">
		<label class="col-sm-4 control-label" >优先级：</label>
		<div class="col-sm-8">
			<div class="col-sm-8">
				<div class="form-control-static" >
					<input type="hidden" id="priority" name="priority"/>
					<div  class="slider_box" >
						<div class="left" >
							低
						</div>
						<div id="slider-range-priority"></div>
						<div class="right" >
							高
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="clearfix"></div>
	<div class="form-group">
		<label class="col-sm-2 control-label" for="name">附件：</label>
		<div class="col-sm-10">
							{:W('FileUpload/edit',array('add_file'=>$vo['add_file']))}
		</div>
	</div>
	<div class="form-group">
		<div class="col-xs-12">
			<textarea  class="editor" id="content" name="content" style="width:100%;height:300px;">{$vo.content}</textarea>
		</div>
	</div>

	<div class="action">
		<input class="btn btn-sm btn-primary" type="button" value="保存" onclick="save();">
		<input  class="btn btn-sm btn-default" type="button" value="取消" onclick="go_return_url();">
	</div>
</form></block>
<block name="js">
<script type="text/javascript">
	function save() {
		window.onbeforeunload=null;
		if (check_form("form_data")) {
			sendForm("form_data", '{:U("save")}');
		}
	};
	$(document).ready(function() {
		$("#priority").val("{$vo.priority}");
		$("#slider-range-priority").slider({
			range : "min",
			min : 1,
			max : 5,
			value : "{$vo.priority}",
			slide : function(event, ui) {
				$("#priority").val(ui.value);
				$("div.slider_box div.ui-slider").css("background-color", schedule_bg(ui.value));
				$("div.slider_box div.ui-widget-header").css("background-color", schedule_bg(ui.value));
			}
		});
		$("div.slider_box div.ui-slider").css("background-color", schedule_bg("{$vo.priority}"));
		$("div.slider_box div.ui-widget-header").css("background-color", schedule_bg("{$vo.priority}"));
	}); 
</script>
</block>